﻿#include "shapepainter.h"
#include <QDebug>

ShapePainter::ShapePainter(QObject* parent, ShapeManager* manager)
	: Painter(parent)
{
	shape_manager = manager;
}

void ShapePainter::paint(QPainter& painter)
{
	for (auto shape : shape_manager->entireShape())
	{
		shape->paintPixmap(painter);
		if (shape_manager->selectShape().size() > 1 || shape_manager->detectShape() == shape)
			shape->paintCircle(painter);
	}
	//单独绘制创造中的图形
	if (shape_manager->createShape() != nullptr)
		shape_manager->createShape()->paintPixmap(painter);
}
